﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web.Mvc;
using $safeprojectname$.Service;

namespace $safeprojectname$
{
    /// <summary>
    ///     IObjectBinder provides any generic T ("Entity") binding of data passed as an IValueContainer.
    ///     This IObjectBinder is available not only for UI,
    ///     and therefor it could be reused for other data transfers
    ///     (e.g. import from MS Excel)
    /// </summary>
    public interface IObjectBinder : IService, IMessagesHolder, IPublishingReporter
    {
        /// <summary>
        /// The System.Web.Mvc binder.
        /// Default represenation in ProjectBase is a SmartBinder
        /// </summary>
        IModelBinder ModelBinder { set; }

        /// <summary>
        /// Operation converting data from IValueContainer into the properties of passed [T] item.
        /// </summary>
        T Bind<T>(T item
            , IValueContainer valueContainer
            , string prefix = null
            , IEnumerable<string> includeProperties = null
            , IEnumerable<string> excludeProperties = null)
            where T : class;

        object Bind(Type type, object item
            , IValueContainer valueContainer
            , string prefix = null
            , IEnumerable<string> includeProperties = null
            , IEnumerable<string> excludeProperties = null);
    }
}